import dva from 'dva';
import { message } from 'antd'
import  createLoading from 'dva-loading'
import './index.css';

// 1. Initialize
const app = dva({
    onError(e) {
        e.preventDefault()
        message.error(e.message, 3);
    },
});

// 2. Plugins
 app.use(createLoading());

// 3. Model
app.model(require('./models/appModel').default);
app.model(require('./models/applicationModel').default);
app.model(require('./models/examinationModel').default);
app.model(require('./models/mechanismOperationModel').default);
app.model(require('./models/uploadFileModel').default)
app.model(require('./models/searchModel').default)
app.model(require('./models/seekTechnologyModel').default)
app.model(require('./models/backstageManagementModel').default)
app.model(require('./models/mechanismPageModel').default)
app.model(require('./models/patentDataModel').default)
app.model(require('./models/policyModel').default)

// 4. Router
app.router(require('./router').default);

// 5. Start
app.start('#root');
